﻿
namespace Mulala.Cavan.Core.Persistent
{
    using System;
    using System.Collections.Generic;
    using System.Diagnostics.Contracts;
    using System.Linq;

    /// <summary>
    ///     The ID is introduced, as the unique identifier based on the DataStorage.
    ///     This ID property is mostly used for GetById(TID) searching.
    /// </summary>
    /// <typeparam name = "TID"></typeparam>
    public interface IPersistentObjectWithTypedId<out TID> : IPersistentObject
    {
        /// <summary>
        ///     ID may be of type int, long, decimal, short, Guid etc.
        ///     Setter is protected to allow set this property via reflection in DAO. 
        ///     Upper layers should only consume this value via public getter.
        /// </summary>
        TID ID { get; }
    }

    /// <summary>
    ///     IPersistentObject interface is the base description for every entity in the framework
    /// </summary>
    public interface IPersistentObject
    {
        DateTime CreateTime { get; set; }
        DateTime EditTime { get; set; }
        string EditUser { get; set; }
    }
}